package com.aspose.cells.a.d;

import java.util.Comparator;

public class zfm implements Comparator {
   public static Comparator a = new zfm();

   public int compare(Object a, Object b) {
      if (a == b) {
         return 0;
      } else if (a == null) {
         return -1;
      } else if (b == null) {
         return 1;
      } else {
         String var3 = (String)a;
         String var4 = (String)b;
         int var5 = var3.length();
         int var6 = var4.length();
         int var7 = 0;

         for(int var8 = 0; var7 < var5 && var8 < var6; ++var8) {
            int var9 = var3.charAt(var7);
            int var10 = var4.charAt(var8);
            if ((var9 | var10) <= 127) {
               if (var9 >= 97 && var9 <= 122) {
                  var9 ^= 32;
               }

               if (var10 >= 97 && var10 <= 122) {
                  var10 ^= 32;
               }

               if (var9 != var10) {
                  return var9 - var10;
               }
            } else if (var9 != var10) {
               char var11 = com.aspose.cells.a.c.zf.a((char)var9);
               char var12 = com.aspose.cells.a.c.zf.a((char)var10);
               if (var11 != var12) {
                  var11 = com.aspose.cells.a.c.zf.b((char)var11);
                  var12 = com.aspose.cells.a.c.zf.b((char)var12);
                  if (var11 != var12) {
                     return var11 - var12;
                  }
               }
            }

            ++var7;
         }

         return var5 - var6;
      }
   }
}
